package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.ProductBean;
import com.project.mapper.IProductMapper;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
@Service
@Transactional
public class ProductServiceImpl implements IProductService {
    @Autowired
    private IProductMapper mapper;
    @Override
    public IPage<ProductBean> findByItem(int pageNO, String name, LocalDate startDate, LocalDate endDate) {
        return mapper.findByItem(new Page<ProductBean>(pageNO,PAGESIZE),name,startDate,endDate);
    }

    @Override
    public ProductBean findById(int id) {
        return mapper.selectById(id);
    }
}
